﻿CREATE FUNCTION [dbo].[fn_TablesAll] ()
RETURNS @Tables TABLE (TableName sysname)
AS
BEGIN
	INSERT INTO @Tables
	  (
	    TableName
	  )
	SELECT t.[name] AS TableName
	FROM   sys.tables t
	WHERE  t.[type] = 'U'
	
	RETURN
END